//
//  Qb_PageControl.m
//  Cd_Qb
//
//  Created by  lliumei on 2018/3/13.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "Qb_PageControl.h"

@implementation Qb_PageControl

- (void)setCurrentPage:(NSInteger)page
{
    [super setCurrentPage:page];
    for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++)
    {
        UIImageView* subview = [self.subviews objectAtIndex:subviewIndex];
        CGSize size;
        size.height = 7;
        
        size.width = 7;
        if (subviewIndex == page)
        {
            size.width = 15;
        }
        [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y,
                                     size.width,size.height)];
    }
    [self setValue:[UIImage imageNamed:@"current_page"] forKeyPath:@"_currentPageImage"];
    [self setValue:[UIImage imageNamed:@"other_page"] forKeyPath:@"_pageImage"];

}



//
//4.设置点的颜色的方法
//
//pageCon.pageIndicatorTintColor = [UIColor blackColor];
//
//pageCon.currentPageIndicatorTintColor = [UIColor redColor];



@end
